/**
 * 
 */
package com.feib.stms.dao.jdbc.rowmapper;

import java.sql.ResultSet;

import org.springframework.jdbc.core.RowMapper;

import com.feib.stms.model.Group;
import com.feib.stms.model.Role;


/**
 * @author Jimmy Liu
 *
 */
public class RoleRowMapper extends BaseRowMapper<Role> implements RowMapper<Role> 
{
	private static final long serialVersionUID = 5452136778908653934L;

	public RoleRowMapper() {
		super(Role.class);
	}
	
	@Override
	protected Role doOtherMapRow(ResultSet rs, int rowNumber, Role entity) 
	{
		entity.setGroup(new Group());
		entity.getGroup().setGroupPk((Long)getColumnValue(rs, "GROUP_PK", Long.class));
		entity.getGroup().setGroupNo((String)getColumnValue(rs, "GROUP_NO", String.class));
		entity.getGroup().setGroupName((String)getColumnValue(rs, "GROUP_NAME", String.class));
		
		return entity;
	}

}
